var express = require('express');
var router = express.Router();
const { checktenants, registers, isRegisters } = require('../service/tenantsService');

//配置二级路径
// router.get('/', function(req, res, next) {
//   res.send('respond with a resource');
// });

//从租赁订单中查看单个租客信息 冰
router.post('/checktenants', async function (req, res, next) {
    const data = await checktenants(req.body)
    res.send(data);
});

/******************练超************************/
//租客注册
router.post('/registers', async function (req, res, next) {
    const data = await registers(req.body)
    res.send(data);
});

//租客验证账号是否存在
router.post('/isRegisters', async function (req, res, next) {
    const result = await isRegisters(req.body);
    res.send(result);
});

//修改租客信用值  廖冬
router.post('/modifyCredits', async function (req, res, next) {
    console.log('第一层', req.body);
    const data = await modifyCredits(req.body);
    res.send(data)
})

module.exports = router;